import React, { Suspense } from 'react'
import ReactDOM from 'react-dom/client'
import { HashRouter } from 'react-router-dom'
import { Provider } from 'react-redux'
import { ThemeProvider } from 'styled-components'

import App from '@/App'
import store from './store'
import 'normalize.css'
import './assets/css/index.less'
import theme from './assets/theme'
const root = ReactDOM.createRoot(document.getElementById('root'))
root.render(
  // <React.StrictMode>
  <Suspense fallback="loading">
    <Provider store={store}>
      <ThemeProvider theme={theme}>
        <HashRouter>
          <App />
        </HashRouter>
      </ThemeProvider>
    </Provider>
  </Suspense>
  // </React.StrictMode>
)

/*
1.新建项目，删除无用东西
  1.1 新建jsconfig.json

2.建立项目需要的文件

3.使用craco修改webpack默认配置
  3.1 配置目录别名
  3.2 配置less

4.配置重置样式
  4.1 引入 normalize.css
  4.2 配置reset.less
  4.3 配置less变量

5.react全家桶react-router
  5.1 安装：npm install react-router-dom
  5.2 导入
  5.3 配置

6.react全家桶react-reduce
  6.1 安装 @reduxjs/toolkit react-redux
*/
